﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace TestXNA3
{
    public static class TestConfig
    {
        private static string _contentPath;
        private static string[] _commandLine;

        public static string ContentPath
        {
            get
            {
                if (_contentPath == null)
                {
                    _contentPath = Directory.GetCurrentDirectory() + "/Content/";
                }

                return _contentPath;
            }
        }

        public static string ParseOption(string optionName)
        {
            if (_commandLine == null)
            {
                _commandLine = Environment.GetCommandLineArgs();
            }
            for ( int i = 0; i < _commandLine.Length; i++ )
            {
                string option = _commandLine[i];
                if (option.Contains("-" + optionName))
                {
                    if (i < _commandLine.Length + 1)
                    {
                        return _commandLine[i + 1];
                    }
                }
            }
            return null;
        }
    }
}
